import java.util.Scanner;

class AdvancedCoffeeShop {
    
    static String[] coffeeNames = {"元宇宙拿铁", "哈希焦糖玛奇朵", "三进制冰美式", "递归卡布奇诺","红河核冰茶"};
    static double[] coffeePrices = {32.0, 36.0, 28.0, 34.0,25.0};
    static String[] coffeeDescriptions = {
        "虚拟与现实的完美融合，奶泡上会有你的数字分身",
        "区块链技术加持，每口都是独一无二的哈希值",
        "极简主义代表，只有0和1两种成分", 
        "无限自我调用的美味，每一口都唤起上一口的记忆",
        "核反应冰茶"
    };
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        // 打招呼
        printWelcome();
        // 询问客户名称
        String name = getName(scanner);
        // 下订单
        String order = takeOrder(scanner);
        // 打印小票
        showOrderSummary(name, order);
        
        scanner.close();
        
        
    }
    
    public static void printWelcome() {
        System.out.println("====================================");
        System.out.println("     欢迎升级版赛博朋克咖啡屋！     ");
        System.out.println("   现已加入AI点餐助手™技术加持    ");
        System.out.println("====================================");
    }
    
    public static String getName(Scanner scanner) {
        System.out.println("\n请问你的名字是？");
        String name = scanner.nextLine();
        System.out.println("嗨，" + name + "！我是你的点餐助手。");
        return name;
    }
    
    public static void showMenu() {
        System.out.println("\n============= 咖啡菜单 =============");
        for(int i = 0; i < coffeeNames.length; i++) {
            System.out.println((i+1) + ". " + coffeeNames[i] + " - ￥" + coffeePrices[i]);
            System.out.println("   " + coffeeDescriptions[i]);
        }
        System.out.println("====================================");
    }
    
    public static String takeOrder(Scanner scanner) {
        showMenu();
        
        System.out.println("\n请输入你想要的咖啡编号 (1-" + coffeeNames.length + "): ");
        int choice = scanner.nextInt();
        
        while(choice < 1 || choice > coffeeNames.length) {
            System.out.println("输入无效，请重新选择 (1-" + coffeeNames.length + "): ");
            choice = scanner.nextInt();
        }
        
        System.out.println("要来几杯呢？");
        int quantity = scanner.nextInt();
        scanner.nextLine(); // 清除缓冲区
        
        double total = coffeePrices[choice-1] * quantity;
        
        return quantity + "杯" + coffeeNames[choice-1] + "，总价: ￥" + total;
    }
    
    public static void showOrderSummary(String name, String order) {
        System.out.println("\n>>> 订单生成中... <<<");
        System.out.println("顾客：" + name);
        System.out.println("订单详情：" + order);
        System.out.println("预计制作时间：5分钟");
        System.out.println("(◕‿◕) 感谢使用AI点餐助手！");
        
        int orderNumber = (int)(Math.random() * 10000);
        System.out.println("你的订单号：" + orderNumber);
    }
}